import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-05-13
 * Time: 14:46
 */
public class Test1 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress address=InetAddress.getLocalHost();
        System.out.println("LocalHost:"+address);
        String  LocalName=address.getHostName();
        System.out.println("LocalName:"+LocalName);

    }
}
